package com.quickask.service;

import com.quickask.entity.AsknowAnswerLocationSetEntity;
import com.quickask.entity.AsknowAnswerSet;
import com.quickask.entity.AsknowAnswerSetEntity;

import java.util.List;
import java.util.Map;

/**
 * Created by NaSa on 2015/10/2.
 */
public interface AnswerService extends BaseService {

    /**
     * 添加问题
     * @param answerJson 答案json数据
     * @param refreshToken 用户token
     */
    public AsknowAnswerSet addAnswer(String answerJson,String refreshToken);


    /**
     * 获取答案列表并根据answerId排序
     * @param pageNo     页码
     * @param pageSize   分页大小
     * @param questionId 问题Id
     * @param properties 其它参数属性(latitude,longitude...)
     * @return
     */
    public List<AsknowAnswerSet> findAnswerListOrderByAnswerId(int pageNo, int pageSize, int questionId, Map<String, Object> properties);


    /**
     * 获取答案列表并根据answerId排序
     * @param pageNo     页码
     * @param pageSize   分页大小
     * @param userId 问题Id
     * @param properties 其它参数属性(latitude,longitude...)
     * @return
     */
    public List<AsknowAnswerSet> findAnswerListByUserId(int pageNo, int pageSize, int userId, Map<String, Object> properties);

    /**
     * 添加答案采纳数
     * @param answerId 答案id
     * @return
     */
    public int AddAnswerAdoptNum(int answerId);


    /**
     * 答案被采纳
     * @param answerId 答案id
     * @return
     */
    public int setAnswerAdopt(int answerId);

    /**
     * 检举答案
     * @param answerId 答案id
     * @param userId 检举人id
     * @return
     */
    public int reportAnswer(int answerId,int userId);
}
